#ifndef _AIRDEF_
#define _AIRDEF_

#include "base.h"

namespace air {

	struct AirCaps {
		int color[4];
		bool isServer;
		char remoteIp[20];

		int remotePort;
		int localPort;
	};

	enum NetMessage {
		ID_GAME_DEFINED = 130
	};

	enum GameMessage {
		ID_EXIT = 1,
		ID_CLIENT_REQ,
		ID_SERVER_ACK,
		ID_SERVER_ACK2,
		ID_GAME_PLAYER_ADD,
		ID_GAME_ACTION_UPDATE,
		ID_GAME_OVERALL_UPDATE
	};

	namespace Packet {
		// from client
		struct ClientReq {
			float x, y, dx, dy;
			uint color;
		};

		// from server
		struct ServerAck {
			uchar playerCount;
			struct {
				float x, y, dx, dy;
				uint color;
			}statusList[10];
		};

		struct GamePlayerAdd {
			uchar remote_id;
			uint color;
			float x, y, dx, dy;
		};

		struct GameOverallUpdate {
			uchar playerCount;
			struct {
				float x, y, dx, dy;
			}statusList[10];
		};

		// both
		struct GameActionUpdate {
			uchar remote_id;
			uint action;
		};
		
	}
}

#endif